package com.example.demo.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.entity.DictionaryCategory;
import com.example.demo.entity.Menu;
import com.example.demo.entity.dto.PageDto;
import com.example.demo.entity.vo.PageVo;
import com.example.demo.service.DictionaryCategoryService;
import com.example.demo.mapper.DictionaryCategoryMapper;
import com.example.demo.util.QueryWraperUtil;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author admin
* @description 针对表【dictionary_category(字典类别表)】的数据库操作Service实现
* @createDate 2024-01-19 10:40:59
*/
@Service
public class DictionaryCategoryServiceImpl extends ServiceImpl<DictionaryCategoryMapper, DictionaryCategory> implements DictionaryCategoryService{

    @Override
    public List<DictionaryCategory> getList(DictionaryCategory dictionaryCategory) {
        return baseMapper.selectList(QueryWraperUtil.getQueryWrap(dictionaryCategory));
    }

    @Override
    public PageVo<DictionaryCategory> getPage(PageDto<DictionaryCategory> pageDto) {
        IPage<DictionaryCategory> iPage=baseMapper.selectPage(new Page<>(pageDto.getCurrent(),pageDto.getSize()),QueryWraperUtil.getQueryWrap(pageDto.getCdt()));
        return new PageVo<>(iPage.getRecords(),iPage.getCurrent(),iPage.getSize(),iPage.getTotal());
    }
}




